#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2025 粤港澳大湾区（广东）国创中心

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

File: pyncti_export_file.py
Desc: Function to export selected objects to a specified file format.
Author: xumanjia
Date: 2025-08-01
"""
from PyQt5.QtWidgets import QFileDialog

def pyncti_export_file(NCTI,doc):
    doc.ResetCaseResult()
    get_filename_path, ok = QFileDialog.getSaveFileName(None,
                            "输入导出的文件",
                            "C:/",
                            "模型文件 (*.igs *.stp *.step *.brep *.sat *.prt)")
    if ok:
        sel = NCTI.SelectionManager(doc) 
        names = sel.ObjectNames
        if len(names) == 0:
            names = doc.AllNames()
        doc.RunCommand("cmd_ncti_export_file", str(get_filename_path), names)